package net.monare.mifss.admin.ui.valid;

import net.monare.mifss.configurations.pojo.ApiMode;

import com.vaadin.data.validator.AbstractValidator;

public class ApiKeyModeValidator extends AbstractValidator<ApiMode>{

	private static final long serialVersionUID = 3333917414531684900L;

	public ApiKeyModeValidator(String errorMessage) {
		super(errorMessage);
	}

	protected boolean isValidValue(ApiMode value) {
		if (value == ApiMode.READ)
			return true;
		else if (value == ApiMode.WRITE)
			return true;
		else
			return false;
	}

	public Class<ApiMode> getType() {
		return ApiMode.class;
	}
	
	
}
